import java.awt.Image;
import java.util.HashMap;

import javax.swing.ImageIcon;

public class ImageLoader {
	public static HashMap<String, Image> images;
	public static ImageLoader imageLoader = new ImageLoader();

	public ImageLoader() {
		images = new HashMap<String, Image>();

		// Cards
		images.put("cardBack", loadImage("images/cards/card.jpg"));
		images.put("redAppleCard", loadImage("images/cards/redApple.jpg"));
		images.put("babyPigCard", loadImage("images/cards/babyPig.jpg"));
		images.put("blazePowderCard", loadImage("images/cards/blazePowder.jpg"));
		images.put("boneCard", loadImage("images/cards/bone.jpg"));
		images.put("cakeCard", loadImage("images/cards/cake.jpg"));
		images.put("spiderCard", loadImage("images/cards/spider.jpg"));
		images.put("diamondSwordCard", loadImage("images/cards/diamondSword.jpg"));
		images.put("endermanCard", loadImage("images/cards/enderman.jpg"));
		images.put("goldIngotCard", loadImage("images/cards/goldIngot.jpg"));
		images.put("lavaBucketCard", loadImage("images/cards/lavaBucket.jpg"));
		images.put("pigCard", loadImage("images/cards/pig.jpg"));
		images.put("redMushroomCard", loadImage("images/cards/redMushroom.jpg"));
		images.put("swordCard", loadImage("images/cards/sword.jpg"));
		images.put("tameWolfCard", loadImage("images/cards/tameWolf.jpg"));
		images.put("wolfCard", loadImage("images/cards/wolf.jpg"));
		images.put("torchCard", loadImage("images/cards/torch.jpg"));
		images.put("waterBucketCard", loadImage("images/cards/waterBucket.jpg"));
		images.put("wheatCard", loadImage("images/cards/wheat.jpg"));

		// Numbers
		images.put("0", loadImage("images/numbers/0.jpg"));
		images.put("1", loadImage("images/numbers/1.jpg"));
		images.put("2", loadImage("images/numbers/2.jpg"));
		images.put("3", loadImage("images/numbers/3.jpg"));
		images.put("4", loadImage("images/numbers/4.jpg"));
		images.put("5", loadImage("images/numbers/5.jpg"));
		images.put("6", loadImage("images/numbers/6.jpg"));
		images.put("7", loadImage("images/numbers/7.jpg"));
		images.put("8", loadImage("images/numbers/8.jpg"));
		images.put("9", loadImage("images/numbers/9.jpg"));
		images.put("10", loadImage("images/numbers/10.jpg"));
		images.put("11", loadImage("images/numbers/11.jpg"));
		images.put("12", loadImage("images/numbers/12.jpg"));
		images.put("13", loadImage("images/numbers/13.jpg"));
		images.put("14", loadImage("images/numbers/14.jpg"));
		images.put("15", loadImage("images/numbers/15.jpg"));
		images.put("16", loadImage("images/numbers/16.jpg"));
		images.put("17", loadImage("images/numbers/17.jpg"));
		images.put("18", loadImage("images/numbers/18.jpg"));
			
		// Backgrounds
		images.put("background1", loadImage("images/backgrounds/background1.jpg"));
		images.put("background2", loadImage("images/backgrounds/background2.jpg"));
		images.put("background3", loadImage("images/backgrounds/background3.jpg"));
		images.put("background4", loadImage("images/backgrounds/background4.jpg"));
		images.put("background5", loadImage("images/backgrounds/background5.jpg"));
		images.put("background6", loadImage("images/backgrounds/background6.jpg"));
		images.put("background7", loadImage("images/backgrounds/background7.jpg"));
		images.put("background8", loadImage("images/backgrounds/background8.jpg"));
		images.put("background9", loadImage("images/backgrounds/background9.jpg"));
		images.put("background10", loadImage("images/backgrounds/background10.jpg"));
		
		// Menus
		images.put("cardsMenu", loadImage("images/menus/cardsMenu.jpg"));
		images.put("mainMenu", loadImage("images/menus/mainMenu.jpg"));
		images.put("aboutMenu", loadImage("images/menus/aboutMenu.jpg"));
		images.put("instructionsMenu", loadImage("images/menus/instructionsMenu.jpg"));
		images.put("gameOver", loadImage("images/menus/gameOver.jpg"));
		
		// Buttons
		images.put("aboutButton", loadImage("images/buttons/aboutButton.jpg"));
		images.put("cardsButton", loadImage("images/buttons/cardsButton.jpg"));
		images.put("instructionButton", loadImage("images/buttons/instructionButton.jpg"));
		images.put("menuButton", loadImage("images/buttons/menuButton.jpg"));
		images.put("littleMenuButton", loadImage("images/buttons/littleMenuButton.jpg"));
		images.put("playButton", loadImage("images/buttons/playButton.jpg"));
		images.put("quitButton", loadImage("images/buttons/quitButton.jpg"));
		images.put("respawnButton", loadImage("images/buttons/respawnButton.jpg"));
		images.put("titleMenuButton", loadImage("images/buttons/titleMenuButton.jpg"));
		
		// Everything else
		images.put("grid", loadImage("images/gameGrid.png"));
		images.put("statPanel", loadImage("images/statPanel.png"));
		images.put("heart", loadImage("images/heart.gif"));
		images.put("title", loadImage("images/title.gif"));
		

	}

	public Image loadImage(String ref) {
		ImageIcon temp = new ImageIcon(ref);
		return temp.getImage();
	}
}
